package com.bnz.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.bnz.entity.User;
import com.bnz.mapper.UserMapper;
import com.bnz.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service  // 将服务发布到zookeeper注册中心中(alibaba)
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    // 1-查询所有数据
    @Override
    public List<User> findAll() {
        List<User> users = userMapper.selectByExample(null); // 条件null表示查询全部数据
        return users;
    }
}
